//
//	UploadConfig.swift
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation


class UploadConfig : NSObject, NSCoding{
    
    var apiUrl : String!
    var userId : String!
    var password : String!
    var interval : String!
    var prefix : String!
    var suffix : String!
    var auto : Bool!
    
    
    /**
     * Instantiate the instance using the passed dictionary values to set the properties values
     */
    init(fromDictionary dictionary: [String:Any]){
        apiUrl = dictionary["apiUrl"] as? String
        interval = dictionary["interval"] as? String
        password = dictionary["password"] as? String
        prefix = dictionary["prefix"] as? String
        suffix = dictionary["suffix"] as? String
        userId = dictionary["userId"] as? String
        auto = dictionary["auto"] as? Bool
    }
    
    /**
     * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
     */
    func toDictionary() -> [String:Any]
    {
        var dictionary = [String:Any]()
        if apiUrl != nil{
            dictionary["apiUrl"] = apiUrl
        }
        if interval != nil{
            dictionary["interval"] = interval
        }
        if password != nil{
            dictionary["password"] = password
        }
        if prefix != nil{
            dictionary["prefix"] = prefix
        }
        if suffix != nil{
            dictionary["suffix"] = suffix
        }
        if userId != nil{
            dictionary["userId"] = userId
        }
        if auto != nil {
            dictionary["auto"] = auto
        }
        return dictionary
    }
    
    /**
     * NSCoding required initializer.
     * Fills the data from the passed decoder
     */
    @objc required init(coder aDecoder: NSCoder)
    {
        apiUrl = aDecoder.decodeObject(forKey: "apiUrl") as? String
        interval = aDecoder.decodeObject(forKey: "interval") as? String
        password = aDecoder.decodeObject(forKey: "password") as? String
        prefix = aDecoder.decodeObject(forKey: "prefix") as? String
        suffix = aDecoder.decodeObject(forKey: "suffix") as? String
        userId = aDecoder.decodeObject(forKey: "userId") as? String
        auto = aDecoder.decodeBool(forKey: "auto") as? Bool
        
    }
    
    /**
     * NSCoding required method.
     * Encodes mode properties into the decoder
     */
    @objc func encode(with aCoder: NSCoder)
    {
        if apiUrl != nil{
            aCoder.encode(apiUrl, forKey: "apiUrl")
        }
        if interval != nil{
            aCoder.encode(interval, forKey: "interval")
        }
        if password != nil{
            aCoder.encode(password, forKey: "password")
        }
        if prefix != nil{
            aCoder.encode(prefix, forKey: "prefix")
        }
        if suffix != nil{
            aCoder.encode(suffix, forKey: "suffix")
        }
        if userId != nil{
            aCoder.encode(userId, forKey: "userId")
        }
        if auto != nil {
            aCoder.encode(auto as Bool, forKey: "auto")
        }
        
    }
    
}
